<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
<title>反转用户输入信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<script type="text/javascript">
    var str = window.prompt('请输入一个字符串！');
    var arr = [];
    for(var i=0; i<str.length; i++) {
        if(i == 0 || i == str.length - 1) {
            arr[i] = str.charAt(i).toUpperCase();
            continue;
        } else {
            arr[i] = str.charAt(i);
        }
    }
    str = arr.reverse().join('');
    alert(str);
</script>

<style type="text/css">
</style>
</head>
    <body>
    </body>
</html>